import type { VNode } from 'vue'
export interface SelectOption {
  label: string
  value: string
  disabled?: boolean
}
export interface SelectProps {
  modelValue: string
  options?: SelectOption[]
  placeholder?: string
  disabled?: boolean
  clearable?: boolean
  renderLabel?: RenderLabelFunc
  filterable?: boolean
  filterMethod?: CustomFilterFunc
  remote?: boolean
  remoteMethod?: CustomFilterRemoteFunc
}
export interface SelectEmits {
  (e: 'update:modelValue', v: string): void
  (e: 'change', v: string): void
  (e: 'visible-change', value: boolean): void
  (e: 'clear'): void
}
export type RenderLabelFunc = (option: SelectOption) => VNode
export type CustomFilterFunc = (value: string) => SelectOption[]
export type CustomFilterRemoteFunc = (value: string) => Promise<SelectOption[]>
export interface SelectStates {
  inputValue: string
  selectOption: null | SelectOption
  mouseHover: boolean
  loading: boolean
  highlightIndex: number
}
